<?php
require('bootstrap.php');
require_once($system['lib_path'].'/Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();
$dbh = new PDO($db['dsn'], $db['userDb'], $db['passDb']);
$conn = Doctrine_Manager::connection($dbh);
$conn->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL);
$conn->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true);
$conn->setAttribute(Doctrine_Core::ATTR_HYDRATE_OVERWRITE, false);
//Allow autoload classes
$manager->setAttribute(Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true);
//Allow accessor overriding
$manager->setAttribute(Doctrine_Core:: ATTR_AUTO_ACCESSOR_OVERRIDE, true);
Doctrine_Core:: generateModelsFromDb($system['model_path'], array('conn'), array('generateTableClasses' => true));